import time
import tkinter as tk
from live_danmu import BiliDanmuCrawler

win = tk.Tk()


def start_crawler():
    crawler = BiliDanmuCrawler(room_id=46936, win=win)
    crawler.run()


win.title('B站直播念弹幕脚本 by王小呆')
x = (win.winfo_screenwidth() - 300) // 2
y = (win.winfo_screenheight() - 500) // 2
win.geometry(f"300x500+{x}+{y}")
tk.Label(win, text="输入直播间ID进行弹幕播报").grid(row=0)
tk.Button(win, text="开始解析", command=start_crawler).grid(row=1)


win.mainloop()
